unit untPesquisaUsuario;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, GridsEh, DBGridEh;

type
  TfrmPesquisaUsuario = class(TForm)
    gdUsuario: TDBGridEh;
    procedure gdUsuarioDblClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure gdUsuarioDrawColumnCell(Sender: TObject; const Rect: TRect;
      DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmPesquisaUsuario: TfrmPesquisaUsuario;

implementation

uses untDModule, untControleAcesso;

{$R *.dfm}

procedure TfrmPesquisaUsuario.gdUsuarioDblClick(Sender: TObject);
begin
  close;
end;

procedure TfrmPesquisaUsuario.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  frmControleAcesso.DesenhaTreeView(DM.dstUsuario, frmControleAcesso.TreeView);
end;

procedure TfrmPesquisaUsuario.FormShow(Sender: TObject);
begin
  dm.dstUsuario.Open;
end;


procedure TfrmPesquisaUsuario.gdUsuarioDrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumnEh;
  State: TGridDrawState);
begin
  if State = [] then
   begin
      if dm.dstUsuario.RecNo Mod 2 = 1 then
      begin
         gdUsuario.Canvas.Brush.Color := clLtGray;
      end
      else
      begin
         gdUsuario.Canvas.Brush.Color := clWhite;
      end;
   end;
   gdUsuario.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;

end.
